package com.winshare.saleAssistant.domain.dto.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel
public class ArticleUpdateDTO {

    @NotNull(message = "主键不可以为空")
    @Range(min = 1, message = "主键为大于或等于1的正整数ß")
    @ApiModelProperty(value = "主键不可以为空")
    private Integer id;

    @NotNull(message = "栏目主键不可以为空")
    @Range(min = 1, message = "栏目主键为大于或等于1的正整数ß")
    @ApiModelProperty(value = "栏目主键")
    private Integer articleModuleId;

    @NotBlank(message = "栏目名称不可以为空")
    @Length(min = 1, max = 100, message = "栏目名称长度需要在1-100个字之间")
    @ApiModelProperty(value = "栏目名称")
    private String articleModuleName;

    @NotBlank(message = "文章标题不可以为空")
    @Length(min = 1, max = 100, message = "文章标题长度需要在1-100个字之间")
    @ApiModelProperty(value = "文章标题")
    private String articleTitle;

    @NotBlank(message = "文章内容不可以为空")
    @Length(min = 1, max = 65535, message = "文章内容长度需要在1-65535个字之间")
    @ApiModelProperty(value = "文章内容")
    private String articleContent;

    @Length(min = 1, max = 100, message = "地点长度需要在1-100个字之间")
    @ApiModelProperty(value = "地点")
    private String address;

    @Length(min = 0, max = 65536, message = "图片url")
    @ApiModelProperty(value = "图片url")
    private String imageUrl;

    @ApiModelProperty(value = "审核机构Id")
    private Integer auditOrgId;

    @Length(min = 0, max = 100, message = "审核机构长度需要在1-100个字之间")
    @ApiModelProperty(value = "审核机构")
    private String auditOrgName;

    @ApiModelProperty(value = "文章描述")
    private String articleDesc;

    @ApiModelProperty(value = "文章标签列表")
    private List<String> articleLabelList;

    public ArticleUpdateDTO() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getArticleModuleId() {
        return articleModuleId;
    }

    public void setArticleModuleId(Integer articleModuleId) {
        this.articleModuleId = articleModuleId;
    }

    public String getArticleModuleName() {
        return articleModuleName;
    }

    public void setArticleModuleName(String articleModuleName) {
        this.articleModuleName = articleModuleName;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public String getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public Integer getAuditOrgId() {
        return auditOrgId;
    }

    public void setAuditOrgId(Integer auditOrgId) {
        this.auditOrgId = auditOrgId;
    }

    public String getAuditOrgName() {
        return auditOrgName;
    }

    public void setAuditOrgName(String auditOrgName) {
        this.auditOrgName = auditOrgName;
    }

    public boolean validAuditInfo() {
        return this.auditOrgId != null && this.auditOrgId != 0 && !StringUtils.isEmpty(this.auditOrgName);
    }

    public String getArticleDesc() {
        return articleDesc;
    }

    public void setArticleDesc(String articleDesc) {
        this.articleDesc = articleDesc;
    }

    public List<String> getArticleLabelList() {
        return articleLabelList;
    }

    public void setArticleLabelList(List<String> articleLabelList) {
        this.articleLabelList = articleLabelList;
    }
}
